package com.linln.modules.member.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.linln.modules.member.domain.MemberRefund;


/**
 * @author hct
 * @date 2019/09/12
 */
public interface MemberRefundRepository extends JpaRepository<MemberRefund, Long> {
	

    public  MemberRefund findByOrderCode(String orderCode);

    /**
  	  * 确认已经退款，修改状态
  	  * @param orderId
  	  * @return
  	  */
     @Modifying
     @Transactional
     @Query("update MemberRefund set refundStatus =1  where refundCode = ?1 and refundStatus=0")
     public Integer updateRefundStatus( String orderId);
     
     
}